<?php
// +----------------------------------------------------------------------
// | WoShiMaiJia Projcet 
// +----------------------------------------------------------------------
// | Copyright (c) 2010 http://woshimaijia.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: xinqiyang <517577550@qq.com>
// +----------------------------------------------------------------------
/**
 * 相册Model
 * @author xinqiyang
 * @date   2010-7-7
 *
 */
class AlbumModel extends MetaModel
{


	protected $_validate  = array(
	array ('title','require','名称不能为空',1,'',1),		
	);


	protected $_auto = array(
	array ('createtime','time',1,'function'),
	array ('user_id','userID',1,'function'),
	array ('image_id','2'),

	);
	
	public function getAlbums($ids)
	{
		return $this->query("
		SELECT sz_album.id,sz_album.title,sz_album.picnum,sz_album.image_id,sz_user.cnname,sz_album.user_id as uid,sz_image.url,sz_image.model,sz_image.filename 
		FROM sz_album,sz_user,sz_image
		WHERE sz_album.id in $ids and sz_album.user_id = sz_user.id and sz_album.image_id = sz_image.id
		");
	}
}
?>